<!doctype html>
<html class="no-js" manifest="__PUBLIC__/home/manifest/test.manifest">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  <title>我的草稿箱</title>
  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">
  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="绵阳中学英才学校"/>
  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileColor" content="#0e90d2">
  <link rel="stylesheet" href="__PUBLIC__/home/css/amazeui.min.css">
  <link rel="stylesheet" href="__PUBLIC__/home/css/app.css">
  <link rel="stylesheet" href="__PUBLIC__/home/css/enrolling.css">
  <link rel="stylesheet" href="__PUBLIC__/home/css/submission.css">
</head>
<body>

      <!-- 头部 -->
      <header data-am-widget="header" class="am-header am-header-default am-no-layout">
        <div class="am-header-left am-header-nav">
          <a href="javascript:history.go(-1);" class="am-header-left1">
            <img src="__PUBLIC__/home/images/back.png" alt="">
          </a>
        </div>

        <h3 class="am-header-title">
            <a href="#title-link" class="">
              我的草稿箱
            </a>
        </h3>

        <div class="am-header-right am-header-nav">
          <a href="#right-link" class="am-header-right1 bianji">
            <!-- <img src="images/tuichubianji.png" alt=""> -->
            <span>退出编辑</span>
          </a>
        </div>
      </header>

      <!-- 中间 -->
        <div class="content">
        <volist name="list" id="vo">
          <div class="content1s">
            <div class="am-u-sm-12">
              <div class="am-u-sm-1">
              	<input type="hidden" value="{$vo.id}">
                <a href="javascript:;">
                  <img src="__PUBLIC__/home/images/xuanze_false.png" alt="">
                </a>
              </div>
              <div class="am-u-sm-11 content2">
                <p>{$vo.title}</p>
              </div>
              <div class="date">
                {$vo['time']|date='Y-m-d H:i:s',###}
              </div>
            </div>
          </div>
          </volist>
      </div>
      <!-- 删除所选 -->
      <div class="am-u-sm-12">
        <button id="delete">删除所选</button>
      </div>

      <!-- 底部 -->
      <include file="Public:footer" />

<script src="__PUBLIC__/home/js/jquery.min.js"></script>
<script src="__PUBLIC__/home/js/amazeui.min.js"></script>
<script src="__PUBLIC__/home/js/limit.js"></script>
<script>
$(function(){
    // 编辑、退出编辑
    $(".bianji").click(function(){
      if($(".bianji span").html() == "退出编辑"){
        $(".content1s .am-u-sm-12 .am-u-sm-1").hide();
        $(".content1s .am-u-sm-12 .am-u-sm-11").addClass("am-u-sm-12");
        $(".bianji span").html("编辑");
      }else{
        $(".content1s .am-u-sm-12 .am-u-sm-1").show();
        $(".content1s .am-u-sm-12 .am-u-sm-11").removeClass("am-u-sm-12");
        $(".bianji span").html("退出编辑");
      }
    });
    // 选择投稿
    $(".content1s .am-u-sm-12").click(function(){
        if($(this).children().children().children().attr("src")=="__PUBLIC__/home/images/xuanze_false.png"){
          $(this).children().children().children().attr("src","__PUBLIC__/home/images/xuanze_true.png").addClass("act");
        }else if($(this).children().children().children().attr("src")=="__PUBLIC__/home/images/xuanze_true.png"){
          $(this).children().children().children().attr("src","__PUBLIC__/home/images/xuanze_false.png").removeClass("act");
        }
    });
    $('#delete').click(function(){
    	var values = [];
    	 $(".act").parent().prev().each(function () {
            values.push($(this).val());
        });
        values = values.join(",");
       	$.ajax({
       		type:"post",
       		url:"{:U('User/draft_delete')}",
       		data:{'id':values},
       		success:function(data){
       			if(data == 1){
       				alert('删除成功');
       			 	$(".act").parent().parent().parent().parent().remove();
       				window.location.href = "{:U('User/user_center')}";
       			}else{
       				alert('失败');
       			}
       		}
       	});
    });
  });
</script>
</body>
</html>